# -*- coding: utf-8 -*-
__author__ = 'xuliliang'
# @Time    : 2018/1/27 下午4:51
# @Author  : 'xuliliang'
# @Email   : xuliliang@u51.com
# @File    : my_inc.py
# @Software: PyCharm


from  django import  template
import shutil

register = template.Library()
# @register
# def show_user_group_minions(pk, user_type, list_type):
#     '''
#     远程命令、模块部署及文件上传中显示主机列表
#     '''
#     if user_type:
#         tgt_list = [i['hostname'] for i in SaltHost.objects.filter(status=True).values('hostname')]
#     else:
#         tgt_list = [i['hostname'] for g in User.objects.get(pk=pk).group.all() for i in
#                     SaltHost.objects.filter(user_group=g).values('hostname')]
#     return {'tgt_list':sorted(list(set(tgt_list))), 'list_type':list_type}
#
# register.inclusion_tag('tag_user_group_minions.html')(show_user_group_minions)

